package org.projectname.service.admin.manager;

import java.util.List;

import org.hishenframework.core.data.jdbc.template.JdbcOperater;
import org.projectname.entity.manager.UserRole;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserRoleService extends JdbcOperater<UserRole>{
	
	public int deleteByUserId(int userId){
		String sql = "DELETE FROM t_system_user_role WHERE user_id = ?";
		return getJdbcTemplate().update(sql, userId);
	}

	public List<UserRole> getByUserId(int userId) {
		String sql = "SELECT * FROM t_system_user_role WHERE user_id = ?";
		return getHishenJdbcTemplate().queryForListBean(sql, UserRole.class, userId);
	}

	@Override
	public int delete(int id) {
		return 0;
	}

	@Override
	public UserRole get(Object pk) {
		return null;
	}
	
	
}
